﻿@inject IStringLocalizer<LightsTooltipText> Localizer

<div class="row g-3">
    <div class="col-12 col-sm-4 col-md-3 col-lg-auto">
        <Light Color="Color.Danger" TooltipText="@Title"></Light>
    </div>
    <div class="col-12 col-sm-4 col-md-3 col-lg-auto">
        <Button Text="Remove Tooltip" OnClick="OnRemoveTitle"></Button>
    </div>
    <div class="col-12 col-sm-4 col-md-3 col-lg-auto">
        <Button Text="Set Tooltip" OnClick="OnSetTitle"></Button>
    </div>
</div>

@code {
    [NotNull]
    private string? Title { get; set; }

    private void OnSetTitle()
    {
        Title = Localizer["TooltipText"];
    }

    private void OnRemoveTitle()
    {
        Title = "";
    }

    /// <summary>
    /// OnInitialized
    /// </summary>
    protected override void OnInitialized()
    {
        base.OnInitialized();

        Title = Localizer["TooltipText"];
    }
}
